V2EX  ›  英汉词典

Parent Class

定义 / Definition

“Parent class”指父类(也叫基类/超类):在面向对象编程中,被其他类(子类)继承其属性和方法的类。也常用 superclass / base class 表达相近概念。(在不同语言/语境中用词略有差异)

发音 / Pronunciation (IPA)

/ˈperənt klæs/

例句 / Examples

A child class can inherit methods from its parent class.
子类可以从父类继承方法。

If the parent class changes its interface, all subclasses may need to be updated to avoid breaking polymorphic behavior.
如果父类更改了接口,所有子类可能都需要更新,以避免破坏多态行为。

词源 / Etymology

“Parent”原意是“父母/家长”,引申为“来源、上一级”;“class”在编程语境中指“类”。合在一起用亲属关系做比喻:父类提供“家族基础”,子类在其之上扩展或重写。这一比喻在面向对象术语中非常常见。

相关词 / Related Words

文学与著作示例 / Notable Works

  • Effective Java(Joshua Bloch)——讨论继承设计时常涉及“父类/超类(superclass)”与子类关系。
  • Design Patterns: Elements of Reusable Object-Oriented Software(Gamma et al.)——在面向对象结构与继承关系的描述中出现相关术语(常以“superclass/base class”呈现)。
  • The C++ Programming Language(Bjarne Stroustrup)——讲解类继承与基类/派生类体系时使用相近概念与表达。
关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   752 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 19:07 · PVG 03:07 · LAX 11:07 · JFK 14:07
♥ Do have faith in what you're doing.